package com.example.administrator.videotest2.util.Tab;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;

import com.example.administrator.videotest2.MainActivity;
import com.example.administrator.videotest2.R;

public class Tab_3Activity extends AppCompatActivity implements View.OnClickListener{

        public final String qq = "https://v.qq.com/";
        public final String youku = "http://www.youku.com/";
        public final String leshi = "http://www.le.com/";
        public final String souhu = "https://tv.sohu.com/";
        public final String aiqiyi = "https://www.iqiyi.com/";
        public final String mangguo = "https://www.mgtv.com/";

        ImageView btn_qq = null;
        ImageView btn_youku = null;
        ImageView btn_aiqiyi = null;
        ImageView btn_leshi = null;
        ImageView btn_souhu = null;
        ImageView btn_mangguo = null;
        Intent intent = null;

        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_tab_3);

            btn_qq = (ImageView) findViewById(R.id.qq);
            btn_youku = (ImageView) findViewById(R.id.youku);
            btn_aiqiyi = (ImageView) findViewById(R.id.aiqiyi);
            btn_leshi = (ImageView) findViewById(R.id.ls);
            btn_souhu = (ImageView) findViewById(R.id.souhu);
            btn_mangguo = (ImageView) findViewById(R.id.mangguo);
            intent = new Intent(Tab_3Activity.this, MainActivity.class);
            btn_qq.setOnClickListener(this);
            btn_youku.setOnClickListener(this);
            btn_aiqiyi.setOnClickListener(this);
            btn_leshi.setOnClickListener(this);
            btn_souhu.setOnClickListener(this);
            btn_mangguo.setOnClickListener(this);
        }

        @Override
        public void onClick(View v) {
            switch (v.getId()) {
                case R.id.qq:
                    intent.putExtra("url1", qq);
                    startActivity(intent);
                    break;
                case R.id.youku:
                    intent.putExtra("url1", youku);
                    startActivity(intent);
                    break;
                case R.id.aiqiyi:
                    intent.putExtra("url1", aiqiyi);
                    startActivity(intent);
                    break;
                case R.id.ls:
                    intent.putExtra("url1", leshi);
                    startActivity(intent);
                    break;
                case R.id.souhu:
                    intent.putExtra("url1", souhu);
                    startActivity(intent);
                    break;
                case R.id.mangguo:
                    intent.putExtra("url1", mangguo);
                    startActivity(intent);
                    break;
            }
        }
}
